/*
 * @Author: your name
 * @Date: 2021-04-20 23:05:33
 * @LastEditTime: 2021-04-20 23:24:34
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \define_Vector\src\main.rs
 */
//1、创建空的vector:Vec<T>
//2、创建包含初始值的vector
//3、丢弃vector
//4、读取元素
//5、遍历
//6、使用枚举

fn main() {
    let mut v:Vec<i32> = Vec::new();
    v.push(1);

    //2
    let v = vec![1,2,3];

    //3
    {
        let v1 = vec![1,2,3];
    }

    //4
    let one: &i32 = &v[0];
    println!("one = {}", one);
     
    match v.get(1){
        Some(value) => println!("value = {}",value),
        _ => println!("None"),
    }
    let mut v2:Vec<i32> = Vec::new();
    v2.push(1);
    println!("hello world");
}